package com.sourcemuch.im.caiba;

import android.content.Context;

import com.xiaomi.mipush.sdk.MiPushClient;

/**
 * Create by HEKE, 2019/8/24 14:11
 * TODO
 */
public class InterfaceReceiversHub {

    /**
     * 绑定回调业务
     */
    public static HKpushsdkinterface hKpushsdkinterface;

    public static void bindHKpushsdkinterface(HKpushsdkinterface hKpushsdkinterface) {
        InterfaceReceiversHub.hKpushsdkinterface = hKpushsdkinterface;
    }

    /**
     * 设定推送用户账号
     *
     * @param context
     * @param phone
     */
    public static void setMiPushAccount(Context context, String phone) {
        if (phone == null || phone.length() == 0) {
            return;
        }
        MiPushClient.setUserAccount(context, phone, null);
    }

    /**
     * 解除小米推送用户账号
     *
     * @param context
     * @param phone
     */
    public static void unsetMiPushAccount(Context context, String phone) {
        if (phone == null || phone.length() == 0) {
            return;
        }
        MiPushClient.unsetUserAccount(context, phone, null);
    }

}

